<?php

namespace App\Http\Controllers\Home;

use Illuminate\Http\Request;

use App\Http\Requests;
use App\Http\Controllers\Controller;
use Session;
use DB;
use Mail;
class IndexController extends Controller
{

    /**
     * [首页]
     * @return {[page] [引入首页页面]
     */
    public function getIndex(Request $req)
    {
        return view('/home/index',['nick_name'=>$req->session()->get('nick_name')]);
    }

    /**
     * [搜索]
     * @return {[page] [引入搜索页面]
     */
    public function getSearch()
    {
      return '这是搜索页面';
    }

    /**
     * [post提交搜索数据]
     * @return {[array] [将数组传入getSearch页面]
     */
    public function postSearch()
    {
      return '这是post过来的搜索数据';
    }
   
     public function getMail()
    {
        Mail::raw('这是一封测试邮件', function ($message) {
            $to = '466628330@qq.com';
            $message ->to($to)->subject('测试邮件');
        });
    }
}

